package com.optionexplorer.data;

import java.util.ArrayList;

public class BaseOptionFilter implements OptionFilterIfc {

	/**
	 * Default implementation everything passes if not overridden.
	 */
	protected  boolean doesQualify(StockOption opt) {
		return true;
	}

	public ArrayList<StockOption> filterData(ArrayList<StockOption> inList) {
		
		ArrayList<StockOption> outList = new ArrayList<StockOption>();
		StockOption opt = null;
		int size = inList.size();
		
		for (int i=0; i<size; i++) {
			opt = inList.get(i);
			if (doesQualify(opt)) {
				outList.add(opt);
			}
		}
		
		return outList;
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
